import request from '@/utils/request'

/**
 *
 * @param {*} params
 * @returns
 */
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    method: 'get',
    params
  })
}

/**
 *  获取行业列表
 *
 * @returns {*}
 */
export function getIndustryListAPI() {
  return request({
    url: '/park/industry',
    method: 'get'
  })
}

/**
 *  上传文件
 *
 * @param {*} data
 */
export function uploadFileAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}

/**
 *  新增企业
 *
 * @param data
 * @returns {*}
 */
export function addEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}

/**
 *
 *  获取企业详情
 *
 * @param id
 * @returns {*}
 */
export function getEnterpriseDetailAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}

/**
 *  更新企业
 * @param data
 * @returns {*}
 */
export function updateEnterpriseAPI(data) {
  return request({
    url: `/park/enterprise/`,
    method: 'PUT',
    data
  })
}

/**
 *
 *  获取合同列表 (企业)
 *
 * @param id
 * @returns {*}
 */
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'GET'
  })
}

/**
 *  退租
 *
 * @param id  合同id
 * @returns {*}
 */
export function outRentAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'PUT'
  })
}

export function getEnterpriseDetailAPI2(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'GET'
  })
}
